import requests


class SendRequest(object):
    def __init__(self):
        self.session = requests.session()

    def send_request(self, method, url, **kwargs):
        if method.lower() == 'get':
            return self.session.get(url, **kwargs)
        elif method.lower() == 'post':
            return self.session.post(url, **kwargs)
        else:
            raise Exception('method error')

# print(SendRequest().send_request('get', 'http://www.baidu.com').text)